/**
 * 
 */
package com.adream.cliniq.server.handler;

import java.util.List;

import com.adream.cliniq.client.ServiceHandler;
import com.adream.cliniq.domain.Person;
import com.adream.cliniq.server.dao.PersonDao;

/**
 * @author apuranik
 *
 */
public class ServiceHandlerImpl extends BaseHandler implements ServiceHandler {

	/* (non-Javadoc)
	 * @see com.adream.cliniq.client.ServiceHandler#handle(java.lang.String, java.lang.String)
	 */
	public String handle(Person person) {
	    PersonDao personDao = this.getDaoFactory().getPersonDao();
        personDao.savePerson(person);
		String token;
		token = "Inserted successfully!!";
		return token;
	}

    public List list() {
        List people = this.getDaoFactory().getPersonDao().listPeople();
        return people;
    }

}
